<template>
    <div class="menu-list" :class="{ 'body-show': value }" v-show="value">
        <SearchBar />
        <div
            class="item"
            v-for="(item, index) in list"
            :key="index"
            @click="toMainPage(item)"
        >
            <span>{{ item.title }}</span>
        </div>
    </div>
</template>

<script>
import SearchBar from "@/components/common/searchBar/index";
export default {
    components: {
        SearchBar
    },
    props: {
        list: Array,
        value: Boolean
    },
    computed: {
        fontColor() {
            return this.active ? "#FFD101" : "#4e4e4";
        }
    },
    data() {
        return {};
    },

    methods: {
        toMainPage(item) {
            console.log(item);
            this.$emit("input", !this.value);
            this.$emit("page-click", item.path);
        }
    }
};
</script>


<style lang="less" scoped>
.menu-list {
    position: fixed;
    z-index: 1000;
    width: 100%;
    height: 100vh;
    box-sizing: border-box;
    padding: 10px 50px 0 50px 0;
    background: #333;
    color: #f5f5f7;

    .item {
        padding: 25px 30px;
        border-bottom: 1px solid #aaa;
    }
}

.body-show {
    animation: showbody 0.4s;
}

@keyframes showbody {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(0);
    }
}
</style>